package com.example.chengche_lol.ui.friend;


import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.chengche_lol.FriendActivity;
import com.example.chengche_lol.R;
import com.example.chengche_lol.adapter.FriendAdapter;
import com.example.chengche_lol.base.BaseFragment;
import com.example.chengche_lol.beans.FriendBean;

public class FriendFragment extends BaseFragment {

    private RecyclerView mRecyclerView;
    private FriendAdapter mFriendAdapter;


//    @Nullable
//    @Override
//    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
//        View view=inflater.inflate(R.layout.fragment_friend,container,false);
//        return view;
//    }

    @Override
    protected int rootLayout() {
        return R.layout.fragment_friend;
    }

    @Override
    protected void initView(View view) {
        mRecyclerView = view.findViewById(R.id.friend_recycleview);
    }

    @Override
    protected void initData() {

        mFriendAdapter = new FriendAdapter();

        FriendBean f1 = new FriendBean(R.drawable.avatar_miku01,"诚诚诚澈","V家学院","一起来做快乐的术术人吧！", "男","Lv39","Vsinger",R.drawable.avatar_miku02,"游戏在线");
        mFriendAdapter.addData(f1);
        FriendBean f2 = new FriendBean(R.drawable.avatar_tianyi01,"魔卡少女樱","魔法学院","隐藏着黑暗力量的钥匙啊！！", "女","Lv50","Manga",R.drawable.avatar_miku02,"游戏在线");
        mFriendAdapter.addData(f2);
        FriendBean f3 = new FriendBean(R.drawable.head_avatar,"柯南","米花小学","真相只有1个！", "男","Lv80","Conan",R.drawable.avatar_miku02,"游戏离线");
        mFriendAdapter.addData(f3);
        FriendBean f4 = new FriendBean(R.drawable.avatar_plug,"哆啦A梦","松芝工厂","dorayaki~sukisuki！", "男","Lv99","Nobi",R.drawable.avatar_miku02,"游戏离线");
        mFriendAdapter.addData(f4);
        FriendBean f5 = new FriendBean(R.drawable.avatar_socket,"我是佐菲","M78星云","消灭地球的计划是我制定的！", "男","Lv98","Ultra",R.drawable.avatar_miku02,"游戏离线");
        mFriendAdapter.addData(f5);
        FriendBean f6 = new FriendBean(R.drawable.avatar_socket,"我是佐菲","M78星云","消灭地球的计划是我制定的！", "男","Lv98","Ultra",R.drawable.avatar_miku02,"游戏离线");
        mFriendAdapter.addData(f6);
    }

    @Override
    protected void bindData() {
        super.bindData();
        mRecyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        mRecyclerView.setAdapter(mFriendAdapter);
    }

    @Override
    protected void bindEvent() {

    }
}